package com.cloudpolice.door.controller;

import com.cloudpolice.door.model.DoorLogModel;
import com.cloudpolice.door.service.DoorLogService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lh.model.ResultVO;
import lh.model.ResultVOPage;
import lh.units.ResultStruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

/**
 * @author ：梁昊，后端工程师：卢春龙
 * @create 2020-04-22 10:30
 * @function
 * @editLog
 */
@RestController
@RequestMapping("/doorLogController")
@Api(value = "门禁日志", description = "门禁日志记录")
public class DoorLogController {
    @Autowired
    DoorLogService doorLogService;

    /**
     * 通用查询门禁记录，方法ID：SE2020042211461987599470A9D5205
     *
     * @param id 表inf_face_log,字段名id:主键
     * @param personId 表inf_face_log,字段名personId:人员ID（居民，物业人员，警务人员)
     * @param personName 表inf_face_log,字段名personName:人员姓名
     * @param sex 表inf_face_log,字段名sex:性别GB/T 2261.1-2003
     * @param mobile 表inf_face_log,字段名mobile:手机号
     * @param personType 表inf_face_log,字段名personType:人员类型（0：居民，1：物业人员，2：警务人员)
     * @param blackType 表inf_face_log,字段名blackType:黑名单人员大类:黑名单、白名单、红名单、或居民
     * @param blackTag 表inf_face_log,字段名blackTag:黑名单标识:黑名单中的细分类
     * @param basePicId 表inf_face_log,字段名basePicId:背景图片ID
     * @param faceBasePicId 表inf_face_log,字段名faceBasePicId:框脸背景图片ID(没有人脸时，本图片为背景图片)
     * @param cardId 表inf_face_log,字段名cardId:RFID卡号
     * @param openType 表inf_face_log,字段名openType:开门方式（0:刷脸，1:RFID卡，2:二维码，3:远程开门）
     * @param sn 表inf_face_log,字段名sn:设备SN号
     * @param equipmentType 表inf_face_log,字段名equipmentType:设备类型,1:门禁机,2:摄像头等
     * @param equipmentName 表inf_face_log,字段名equipmentName:设备名称
     * @param communityId 表inf_face_log,字段名communityId:场所ID（小区ID、学校ID等 )
     * @param communityName 表inf_face_log,字段名communityName:场所名（小区名、学校名等）
     * @param periodId 表inf_face_log,字段名periodId:场所区域ID（小区区域ID、学校区域ID等）
     * @param periodName 表inf_face_log,字段名periodName:场所区域名（小区区域名、学校区域名等）
     * @param buildId 表inf_face_log,字段名buildId:楼栋ID
     * @param buildName 表inf_face_log,字段名buildName:楼栋名
     * @param unitId 表inf_face_log,字段名unitId:单元ID
     * @param unitName 表inf_face_log,字段名unitName:单元名
     * @param accessId 表inf_face_log,字段名accessId:通道ID
     * @param accessName 表inf_face_log,字段名accessName:通道名称
     * @param longitude 表inf_face_log,字段名longitude:经度
     * @param latitude 表inf_face_log,字段名latitude:纬度
     * @param aiType 表inf_face_log,字段名aiType:门禁机人工智能算法名称
     * @param aiAfterType 表inf_face_log,字段名aiAfterType:后台人工智能算法名称
     * @param aiClass 表inf_face_log,字段名aiClass:比对方式（0：离线；1：在线）
     * @param doorTime 表inf_face_log,字段名doorTime:门禁机抓拍时间
     * @param createTime 表inf_face_log,字段名createTime:台后得到此数据时间
     * @param updateTime 表inf_face_log,字段名updateTime:人工智能比对完成时间
     * @param remark 表inf_face_log,字段名remark:备注
     * @param page 当前页数
     * @param limit 每页条数
     * @return 结果
     */
    @ApiOperation(value = "通用查询门禁记录,方法ID：SE2020042211461987599470A9D5205", notes = "结果")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "主键", dataType = "String"),
            @ApiImplicitParam(name = "personId", value = "人员ID（居民，物业人员，警务人员)", dataType = "String"),
            @ApiImplicitParam(name = "personName", value = "人员姓名", dataType = "String"),
            @ApiImplicitParam(name = "sex", value = "性别GB/T 2261.1-2003", dataType = "String"),
            @ApiImplicitParam(name = "mobile", value = "手机号", dataType = "String"),
            @ApiImplicitParam(name = "personType", value = "人员类型（0：居民，1：物业人员，2：警务人员)", dataType = "String"),
            @ApiImplicitParam(name = "blackType", value = "黑名单人员大类:黑名单、白名单、红名单、或居民", dataType = "String"),
            @ApiImplicitParam(name = "blackTag", value = "黑名单标识:黑名单中的细分类", dataType = "String"),
            @ApiImplicitParam(name = "basePicId", value = "背景图片ID", dataType = "String"),
            @ApiImplicitParam(name = "faceBasePicId", value = "框脸背景图片ID(没有人脸时，本图片为背景图片)", dataType = "String"),
            @ApiImplicitParam(name = "cardId", value = "RFID卡号", dataType = "String"),
            @ApiImplicitParam(name = "openType", value = "开门方式（0:刷脸，1:RFID卡，2:二维码，3:远程开门）", dataType = "String"),
            @ApiImplicitParam(name = "sn", value = "设备SN号", dataType = "String"),
            @ApiImplicitParam(name = "equipmentType", value = "设备类型,1:门禁机,2:摄像头等", dataType = "String"),
            @ApiImplicitParam(name = "equipmentName", value = "设备名称", dataType = "String"),
            @ApiImplicitParam(name = "communityId", value = "场所ID（小区ID、学校ID等 )", dataType = "String"),
            @ApiImplicitParam(name = "communityName", value = "场所名（小区名、学校名等）", dataType = "String"),
            @ApiImplicitParam(name = "periodId", value = "场所区域ID（小区区域ID、学校区域ID等）", dataType = "String"),
            @ApiImplicitParam(name = "periodName", value = "场所区域名（小区区域名、学校区域名等）", dataType = "String"),
            @ApiImplicitParam(name = "buildId", value = "楼栋ID", dataType = "String"),
            @ApiImplicitParam(name = "buildName", value = "楼栋名", dataType = "String"),
            @ApiImplicitParam(name = "unitId", value = "单元ID", dataType = "String"),
            @ApiImplicitParam(name = "unitName", value = "单元名", dataType = "String"),
            @ApiImplicitParam(name = "accessId", value = "通道ID", dataType = "String"),
            @ApiImplicitParam(name = "accessName", value = "通道名称", dataType = "String"),
            @ApiImplicitParam(name = "longitude", value = "经度", dataType = "Float"),
            @ApiImplicitParam(name = "latitude", value = "纬度", dataType = "Float"),
            @ApiImplicitParam(name = "aiType", value = "门禁机人工智能算法名称", dataType = "String"),
            @ApiImplicitParam(name = "aiAfterType", value = "后台人工智能算法名称", dataType = "String"),
            @ApiImplicitParam(name = "aiClass", value = "比对方式（0：离线；1：在线）", dataType = "Boolean"),
            @ApiImplicitParam(name = "doorTime", value = "门禁机抓拍时间", dataType = "Date"),
            @ApiImplicitParam(name = "createTime", value = "台后得到此数据时间", dataType = "Date"),
            @ApiImplicitParam(name = "updateTime", value = "人工智能比对完成时间", dataType = "Date"),
            @ApiImplicitParam(name = "remark", value = "备注", dataType = "String"),
            @ApiImplicitParam(name = "page", value = "当前页数", dataType = "Integer"),
            @ApiImplicitParam(name = "limit", value = "每页条数", dataType = "Integer")
    })
    @PostMapping("/getDoorLog")
    public ResultVOPage getDoorLog(@RequestParam(value = "id", required = false) String id
            , @RequestParam(value = "personId", required = false) String personId
            , @RequestParam(value = "personName", required = false) String personName
            , @RequestParam(value = "sex", required = false, defaultValue = "0") String sex
            , @RequestParam(value = "mobile", required = false) String mobile
            , @RequestParam(value = "personType", required = false) Integer personType
            , @RequestParam(value = "blackType", required = false) String blackType
            , @RequestParam(value = "blackTag", required = false) String blackTag
            , @RequestParam(value = "basePicId", required = false) String basePicId
            , @RequestParam(value = "faceBasePicId", required = false) String faceBasePicId
            , @RequestParam(value = "cardId", required = false) String cardId
            , @RequestParam(value = "openType", required = false, defaultValue = "0") Integer openType
            , @RequestParam(value = "sn", required = false) String sn
            , @RequestParam(value = "equipmentType", required = false) Integer equipmentType
            , @RequestParam(value = "equipmentName", required = false) String equipmentName
            , @RequestParam(value = "communityId", required = false) String communityId
            , @RequestParam(value = "communityName", required = false) String communityName
            , @RequestParam(value = "periodId", required = false) String periodId
            , @RequestParam(value = "periodName", required = false) String periodName
            , @RequestParam(value = "buildId", required = false) String buildId
            , @RequestParam(value = "buildName", required = false) String buildName
            , @RequestParam(value = "unitId", required = false) String unitId
            , @RequestParam(value = "unitName", required = false) String unitName
            , @RequestParam(value = "accessId", required = false) String accessId
            , @RequestParam(value = "accessName", required = false) String accessName
            , @RequestParam(value = "longitude", required = false) Float longitude
            , @RequestParam(value = "latitude", required = false) Float latitude
            , @RequestParam(value = "aiType", required = false) String aiType
            , @RequestParam(value = "aiAfterType", required = false) String aiAfterType
            , @RequestParam(value = "aiClass", required = false, defaultValue = "0") boolean aiClass
            , @RequestParam(value = "doorTime", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date doorTime
            , @RequestParam(value = "createTime", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date createTime
            , @RequestParam(value = "updateTime", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date updateTime
            , @RequestParam(value = "remark", required = false) String remark
            , @RequestParam(value = "page", defaultValue = "1") int page
            , @RequestParam(value = "limit", defaultValue = "10") int limit) {
        id = id == null ? id : id.trim();
        personId = personId == null ? personId : personId.trim();
        personName = personName == null ? personName : personName.trim();
        mobile = mobile == null ? mobile : mobile.trim();
        blackType = blackType == null ? blackType : blackType.trim();
        blackTag = blackTag == null ? blackTag : blackTag.trim();
        basePicId = basePicId == null ? basePicId : basePicId.trim();
        faceBasePicId = faceBasePicId == null ? faceBasePicId : faceBasePicId.trim();
        cardId = cardId == null ? cardId : cardId.trim();
        sn = sn == null ? sn : sn.trim();
        equipmentName = equipmentName == null ? equipmentName : equipmentName.trim();
        communityId = communityId == null ? communityId : communityId.trim();
        communityName = communityName == null ? communityName : communityName.trim();
        periodId = periodId == null ? periodId : periodId.trim();
        periodName = periodName == null ? periodName : periodName.trim();
        buildId = buildId == null ? buildId : buildId.trim();
        buildName = buildName == null ? buildName : buildName.trim();
        unitId = unitId == null ? unitId : unitId.trim();
        unitName = unitName == null ? unitName : unitName.trim();
        accessId = accessId == null ? accessId : accessId.trim();
        accessName = accessName == null ? accessName : accessName.trim();
        aiType = aiType == null ? aiType : aiType.trim();
        aiAfterType = aiAfterType == null ? aiAfterType : aiAfterType.trim();
        remark = remark == null ? remark : remark.trim();

        DoorLogModel doorLogModel = new DoorLogModel();
        doorLogModel.setId(id);
        doorLogModel.setPersonId(personId);
        doorLogModel.setPersonName(personName);
        doorLogModel.setSex(sex);
        doorLogModel.setMobile(mobile);
        doorLogModel.setPersonType(personType);
        doorLogModel.setBlackType(blackType);
        doorLogModel.setBlackTag(blackTag);
        doorLogModel.setBasePicId(basePicId);
        doorLogModel.setFaceBasePicId(faceBasePicId);
        doorLogModel.setCardId(cardId);
        doorLogModel.setOpenType(openType);
        doorLogModel.setSn(sn);
        doorLogModel.setEquipmentType(equipmentType);
        doorLogModel.setEquipmentName(equipmentName);
        doorLogModel.setCommunityId(communityId);
        doorLogModel.setCommunityName(communityName);
        doorLogModel.setPeriodId(periodId);
        doorLogModel.setPeriodName(periodName);
        doorLogModel.setBuildId(buildId);
        doorLogModel.setBuildName(buildName);
        doorLogModel.setUnitId(unitId);
        doorLogModel.setUnitName(unitName);
        doorLogModel.setAccessId(accessId);
        doorLogModel.setAccessName(accessName);
        doorLogModel.setLongitude(longitude);
        doorLogModel.setLatitude(latitude);
        doorLogModel.setAiType(aiType);
        doorLogModel.setAiAfterType(aiAfterType);
        doorLogModel.setAiClass(aiClass);
        doorLogModel.setDoorTime(doorTime);
        doorLogModel.setCreateTime(createTime);
        doorLogModel.setUpdateTime(updateTime);
        doorLogModel.setRemark(remark);

        PageHelper.startPage(page, limit);
        List<DoorLogModel> doorLogModels = doorLogService.getDoorLog(doorLogModel);
        PageInfo pageInfo = new PageInfo<>(doorLogModels, limit);
        return ResultStruct.successPage(doorLogModels, pageInfo.getPageNum(), pageInfo.getPageSize(), pageInfo.getTotal());
    }



    /**
     * 插入门禁记录，方法ID：IN2020042210291541360390797DF76
     *
     * @param id 主键
     * @param personId 人员ID（居民，物业人员，警务人员)
     * @param personName 人员姓名
     * @param sex 性别GB/T 2261.1-2003
     * @param mobile 手机号
     * @param personType 人员类型（0：居民，1：物业人员，2：警务人员)
     * @param blackType 黑名单人员大类:黑名单、白名单、红名单、或居民
     * @param blackTag 黑名单标识:黑名单中的细分类
     * @param basePicId 背景图片ID
     * @param faceBasePicId 框脸背景图片ID(没有人脸时，本图片为背景图片)
     * @param cardId RFID卡号
     * @param openType 开门方式（0:刷脸，1:RFID卡，2:二维码，3:远程开门）
     * @param sn 设备SN号
     * @param equipmentType 设备类型,1:门禁机,2:摄像头等
     * @param equipmentName 设备名称
     * @param communityId 场所ID（小区ID、学校ID等 )
     * @param communityName 场所名（小区名、学校名等）
     * @param periodId 场所区域ID（小区区域ID、学校区域ID等）
     * @param periodName 场所区域名（小区区域名、学校区域名等）
     * @param buildId 楼栋ID
     * @param buildName 楼栋名
     * @param unitId 单元ID
     * @param unitName 单元名
     * @param accessId 通道ID
     * @param accessName 通道名称
     * @param longitude 经度
     * @param latitude 纬度
     * @param aiType 门禁机人工智能算法名称
     * @param aiAfterType 后台人工智能算法名称
     * @param aiClass 比对方式（0：离线；1：在线）
     * @param doorTime 门禁机抓拍时间
     * @param createTime 台后得到此数据时间
     * @param updateTime 人工智能比对完成时间
     * @param stopSign 0：人工智能比对未完成，1：人工智能比对已完成
     * @param remark 备注
     * @return 结果
     */
    @ApiOperation(value = "插入门禁记录,方法ID：IN2020042210291541360390797DF76", notes = "结果")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "主键", dataType = "String", required = true)
            , @ApiImplicitParam(name = "personId", value = "人员ID（居民，物业人员，警务人员)", dataType = "String", required = true)
            , @ApiImplicitParam(name = "personName", value = "人员姓名", dataType = "String")
            , @ApiImplicitParam(name = "sex", value = "性别GB/T 2261.1-2003", dataType = "String")
            , @ApiImplicitParam(name = "mobile", value = "手机号", dataType = "String")
            , @ApiImplicitParam(name = "personType", value = "人员类型（0：居民，1：物业人员，2：警务人员)", dataType = "Integer", required = true)
            , @ApiImplicitParam(name = "blackType", value = "黑名单人员大类:黑名单、白名单、红名单、或居民", dataType = "String")
            , @ApiImplicitParam(name = "blackTag", value = "黑名单标识:黑名单中的细分类", dataType = "String")
            , @ApiImplicitParam(name = "basePicId", value = "背景图片ID", dataType = "String", required = true)
            , @ApiImplicitParam(name = "faceBasePicId", value = "框脸背景图片ID(没有人脸时，本图片为背景图片)", dataType = "String", required = true)
            , @ApiImplicitParam(name = "cardId", value = "RFID卡号", dataType = "String")
            , @ApiImplicitParam(name = "openType", value = "开门方式（0:刷脸，1:RFID卡，2:二维码，3:远程开门）", dataType = "Integer", required = true)
            , @ApiImplicitParam(name = "sn", value = "设备SN号", dataType = "String", required = true)
            , @ApiImplicitParam(name = "equipmentType", value = "设备类型,1:门禁机,2:摄像头等", dataType = "Integer")
            , @ApiImplicitParam(name = "equipmentName", value = "设备名称", dataType = "String")
            , @ApiImplicitParam(name = "communityId", value = "场所ID（小区ID、学校ID等 )", dataType = "String")
            , @ApiImplicitParam(name = "communityName", value = "场所名（小区名、学校名等）", dataType = "String")
            , @ApiImplicitParam(name = "periodId", value = "场所区域ID（小区区域ID、学校区域ID等）", dataType = "String")
            , @ApiImplicitParam(name = "periodName", value = "场所区域名（小区区域名、学校区域名等）", dataType = "String")
            , @ApiImplicitParam(name = "buildId", value = "楼栋ID", dataType = "String")
            , @ApiImplicitParam(name = "buildName", value = "楼栋名", dataType = "String")
            , @ApiImplicitParam(name = "unitId", value = "单元ID", dataType = "String")
            , @ApiImplicitParam(name = "unitName", value = "单元名", dataType = "String")
            , @ApiImplicitParam(name = "accessId", value = "通道ID", dataType = "String")
            , @ApiImplicitParam(name = "accessName", value = "通道名称", dataType = "String")
            , @ApiImplicitParam(name = "longitude", value = "经度", dataType = "Float")
            , @ApiImplicitParam(name = "latitude", value = "纬度", dataType = "Float")
            , @ApiImplicitParam(name = "aiType", value = "门禁机人工智能算法名称", dataType = "String", required = true)
            , @ApiImplicitParam(name = "aiAfterType", value = "后台人工智能算法名称", dataType = "String")
            , @ApiImplicitParam(name = "aiClass", value = "比对方式（0：离线；1：在线）", dataType = "Boolean", required = true)
            , @ApiImplicitParam(name = "doorTime", value = "门禁机抓拍时间", dataType = "Date", required = true)
            , @ApiImplicitParam(name = "createTime", value = "台后得到此数据时间", dataType = "Date", required = true)
            , @ApiImplicitParam(name = "updateTime", value = "人工智能比对完成时间", dataType = "Date", required = true)
            , @ApiImplicitParam(name = "stopSign", value = "0：人工智能比对未完成，1：人工智能比对已完成", dataType = "Integer", required = true)
            , @ApiImplicitParam(name = "remark", value = "备注", dataType = "String")
    })
    @PostMapping("/insertDoorLog")
    public ResultVO insertDoorLog(@RequestParam(value = "id") String id
            , @RequestParam(value = "personId") String personId
            , @RequestParam(value = "personName", required = false) String personName
            , @RequestParam(value = "sex", required = false, defaultValue = "0") String sex
            , @RequestParam(value = "mobile", required = false) String mobile
            , @RequestParam(value = "personType") int personType
            , @RequestParam(value = "blackType", required = false) String blackType
            , @RequestParam(value = "blackTag", required = false) String blackTag
            , @RequestParam(value = "basePicId") String basePicId
            , @RequestParam(value = "faceBasePicId") String faceBasePicId
            , @RequestParam(value = "cardId", required = false) String cardId
            , @RequestParam(value = "openType", defaultValue = "0") int openType
            , @RequestParam(value = "sn") String sn
            , @RequestParam(value = "equipmentType", required = false) int equipmentType
            , @RequestParam(value = "equipmentName", required = false) String equipmentName
            , @RequestParam(value = "communityId", required = false) String communityId
            , @RequestParam(value = "communityName", required = false) String communityName
            , @RequestParam(value = "periodId", required = false) String periodId
            , @RequestParam(value = "periodName", required = false) String periodName
            , @RequestParam(value = "buildId", required = false) String buildId
            , @RequestParam(value = "buildName", required = false) String buildName
            , @RequestParam(value = "unitId", required = false) String unitId
            , @RequestParam(value = "unitName", required = false) String unitName
            , @RequestParam(value = "accessId", required = false) String accessId
            , @RequestParam(value = "accessName", required = false) String accessName
            , @RequestParam(value = "longitude", required = false) float longitude
            , @RequestParam(value = "latitude", required = false) float latitude
            , @RequestParam(value = "aiType") String aiType
            , @RequestParam(value = "aiAfterType", required = false) String aiAfterType
            , @RequestParam(value = "aiClass", defaultValue = "0") boolean aiClass
            , @RequestParam(value = "doorTime") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date doorTime
            , @RequestParam(value = "createTime") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date createTime
            , @RequestParam(value = "updateTime") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date updateTime
            , @RequestParam(value = "stopSign", defaultValue = "0") int stopSign
            , @RequestParam(value = "remark", required = false) String remark) {
        personId = personId == null ? personId : personId.trim();
        personName = personName == null ? personName : personName.trim();
        sex = sex == null ? sex : sex.trim();
        mobile = mobile == null ? mobile : mobile.trim();
        blackType = blackType == null ? blackType : blackType.trim();
        blackTag = blackTag == null ? blackTag : blackTag.trim();
        basePicId = basePicId == null ? basePicId : basePicId.trim();
        faceBasePicId = faceBasePicId == null ? faceBasePicId : faceBasePicId.trim();
        cardId = cardId == null ? cardId : cardId.trim();
        sn = sn == null ? sn : sn.trim();
        equipmentName = equipmentName == null ? equipmentName : equipmentName.trim();
        communityId = communityId == null ? communityId : communityId.trim();
        communityName = communityName == null ? communityName : communityName.trim();
        periodId = periodId == null ? periodId : periodId.trim();
        periodName = periodName == null ? periodName : periodName.trim();
        buildId = buildId == null ? buildId : buildId.trim();
        buildName = buildName == null ? buildName : buildName.trim();
        unitId = unitId == null ? unitId : unitId.trim();
        unitName = unitName == null ? unitName : unitName.trim();
        accessId = accessId == null ? accessId : accessId.trim();
        accessName = accessName == null ? accessName : accessName.trim();
        aiType = aiType == null ? aiType : aiType.trim();
        aiAfterType = aiAfterType == null ? aiAfterType : aiAfterType.trim();
        remark = remark == null ? remark : remark.trim();

        DoorLogModel doorLogModel = new DoorLogModel();
        doorLogModel.setId(id);
        doorLogModel.setPersonId(personId);
        doorLogModel.setPersonName(personName);
        doorLogModel.setSex(sex);
        doorLogModel.setMobile(mobile);
        doorLogModel.setPersonType(personType);
        doorLogModel.setBlackType(blackType);
        doorLogModel.setBlackTag(blackTag);
        doorLogModel.setBasePicId(basePicId);
        doorLogModel.setFaceBasePicId(faceBasePicId);
        doorLogModel.setCardId(cardId);
        doorLogModel.setOpenType(openType);
        doorLogModel.setSn(sn);
        doorLogModel.setEquipmentType(equipmentType);
        doorLogModel.setEquipmentName(equipmentName);
        doorLogModel.setCommunityId(communityId);
        doorLogModel.setCommunityName(communityName);
        doorLogModel.setPeriodId(periodId);
        doorLogModel.setPeriodName(periodName);
        doorLogModel.setBuildId(buildId);
        doorLogModel.setBuildName(buildName);
        doorLogModel.setUnitId(unitId);
        doorLogModel.setUnitName(unitName);
        doorLogModel.setAccessId(accessId);
        doorLogModel.setAccessName(accessName);
        doorLogModel.setLongitude(longitude);
        doorLogModel.setLatitude(latitude);
        doorLogModel.setAiType(aiType);
        doorLogModel.setAiAfterType(aiAfterType);
        doorLogModel.setAiClass(aiClass);
        doorLogModel.setDoorTime(doorTime);
        doorLogModel.setCreateTime(createTime);
        doorLogModel.setUpdateTime(updateTime);
        doorLogModel.setStopSign(stopSign);
        doorLogModel.setRemark(remark);
        int resultCount = doorLogService.insertDoorLog(doorLogModel);
        if (resultCount > 0)
            return ResultStruct.success(resultCount);
        else
            return ResultStruct.error("增加失败", ResultVO.class, int.class);
    }


}

